import request from "@/utils/request";

// 帖子管理
export function fetchList(params) {
  return request({
    url: "/community/index",
    method: "get",
    params
  });
}

export function exportExcel(params) {
  return request({
    url: "/community/export",
    method: "get",
    params,
    responseType: "blob"
  });
}

export function getInfo(params) {
  return request({
    url: "/community/read",
    method: "get",
    params
  });
}

export function getComments(params) {
  return request({
    url: "/community/post_comment",
    method: "get",
    params
  });
}

export function remove(params) {
  return request({
    url: "/community/delete",
    method: "get",
    params
  });
}

export function setIsShow(params) {
  return request({
    url: "/community/set_is_show",
    method: "get",
    params
  });
}

// 评论管理
export function fetchCommentsList(params) {
  return request({
    url: "/community/comments",
    method: "get",
    params
  });
}

export function exportCommentsExcel(params) {
  return request({
    url: "/community/comment_export",
    method: "get",
    params,
    responseType: "blob"
  });
}
